package com.wunong.smart.collection.starter;

import com.wunong.smart.collection.repository.CollectionRepository;
import com.wunong.smart.collection.starter.repository.CollectionRepositoryImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author create by zealot.zt
 */
@MapperScan(CollectionStarterConfiguration.DAO_PACKAGE)
@Configuration
@ComponentScan(CollectionStarterConfiguration.PACKAGE)
public class CollectionStarterConfiguration {

    public static final String PACKAGE = "com.wunong.smart.collection";

    public static final String DAO_PACKAGE = "com.wunong.smart.collection.starter.infrastructure.mapper";

    public static final String PO_PACKAGE = "com.wunong.smart.collection.starter.infrastructure.po";

    @ConditionalOnMissingBean(CollectionRepository.class)
    @Bean
    public CollectionRepository defaultCollectionRepository() {
        return new CollectionRepositoryImpl();
    }

}
